//
//  ShopData.m
//  __PRODUCTNAME__
//
//  Created by LL.F on 16/09/09
//  Copyright (c) __ORGANIZATIONNAME__. All rights reserved.
//

#import "ShopData.h"
#import "ShopScrollbanner.h"
#import "ShopListcommodity.h"
#import "ShopTopbanner.h"

@implementation ShopData

+ (NSDictionary *)objectClassInArray{
    return @{@"scrollBanner" : [ShopScrollbanner class], @"listCommodity" : [ShopListcommodity class], @"topBanner" : [ShopTopbanner class]};
}
- (void)setValue:(id)value forKey:(NSString *)key
{
    
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"scrollBanner"]) {
        NSMutableArray<ShopScrollbanner *>  *scrollArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            ShopScrollbanner *data = [ShopScrollbanner modelWithDic:dic];
            [scrollArray addObject:data];
        }
        _scrollBanner = scrollArray;
    }
    if ([key isEqualToString:@"listCommodity"]) {
        NSMutableArray<ShopListcommodity *>  *commodityArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            ShopListcommodity *data = [ShopListcommodity modelWithDic:dic];
            [commodityArray addObject:data];
        }
        _listCommodity = commodityArray;
    }
    if ([key isEqualToString:@"topBanner"]) {
        NSMutableArray<ShopTopbanner *>  *topArray = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            ShopTopbanner *data = [ShopTopbanner modelWithDic:dic];
            [topArray addObject:data];
        }
        _topBanner = topArray;
    }
}
@end
